/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'ap-northeast-1' = 'cloudpush.aliyuncs.com',
    'ap-northeast-2-pop' = 'cloudpush.aliyuncs.com',
    'ap-south-1' = 'cloudpush.aliyuncs.com',
    'ap-southeast-1' = 'cloudpush.aliyuncs.com',
    'ap-southeast-2' = 'cloudpush.aliyuncs.com',
    'ap-southeast-3' = 'cloudpush.aliyuncs.com',
    'ap-southeast-5' = 'cloudpush.aliyuncs.com',
    'cn-beijing' = 'cloudpush.aliyuncs.com',
    'cn-beijing-finance-1' = 'cloudpush.aliyuncs.com',
    'cn-beijing-finance-pop' = 'cloudpush.aliyuncs.com',
    'cn-beijing-gov-1' = 'cloudpush.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'cloudpush.aliyuncs.com',
    'cn-chengdu' = 'cloudpush.aliyuncs.com',
    'cn-edge-1' = 'cloudpush.aliyuncs.com',
    'cn-fujian' = 'cloudpush.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'cloudpush.aliyuncs.com',
    'cn-hangzhou' = 'cloudpush.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'cloudpush.aliyuncs.com',
    'cn-hangzhou-finance' = 'cloudpush.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'cloudpush.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'cloudpush.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'cloudpush.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'cloudpush.aliyuncs.com',
    'cn-hangzhou-test-306' = 'cloudpush.aliyuncs.com',
    'cn-hongkong' = 'cloudpush.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'cloudpush.aliyuncs.com',
    'cn-huhehaote' = 'cloudpush.aliyuncs.com',
    'cn-north-2-gov-1' = 'cloudpush.aliyuncs.com',
    'cn-qingdao' = 'cloudpush.aliyuncs.com',
    'cn-qingdao-nebula' = 'cloudpush.aliyuncs.com',
    'cn-shanghai' = 'cloudpush.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'cloudpush.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'cloudpush.aliyuncs.com',
    'cn-shanghai-finance-1' = 'cloudpush.aliyuncs.com',
    'cn-shanghai-inner' = 'cloudpush.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'cloudpush.aliyuncs.com',
    'cn-shenzhen' = 'cloudpush.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'cloudpush.aliyuncs.com',
    'cn-shenzhen-inner' = 'cloudpush.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'cloudpush.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'cloudpush.aliyuncs.com',
    'cn-wuhan' = 'cloudpush.aliyuncs.com',
    'cn-yushanfang' = 'cloudpush.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'cloudpush.aliyuncs.com',
    'cn-zhangjiakou' = 'cloudpush.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'cloudpush.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'cloudpush.aliyuncs.com',
    'eu-central-1' = 'cloudpush.aliyuncs.com',
    'eu-west-1' = 'cloudpush.aliyuncs.com',
    'eu-west-1-oxs' = 'cloudpush.aliyuncs.com',
    'me-east-1' = 'cloudpush.aliyuncs.com',
    'rus-west-1-pop' = 'cloudpush.aliyuncs.com',
    'us-east-1' = 'cloudpush.aliyuncs.com',
    'us-west-1' = 'cloudpush.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('push', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model BindAliasRequest {
  aliasName?: string(name='AliasName', description='This parameter is required.', example='test_alias'),
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='e2ba19de97604f55b16557673****'),
}

model BindAliasResponseBody = {
  requestId?: string(name='RequestId', example='159E4422-6624-4750-8943-DFD98D34858C'),
}

model BindAliasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAliasResponseBody(name='body'),
}

/**
 * @summary 绑定别名
 *
 * @param request BindAliasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAliasResponse
 */
async function bindAliasWithOptions(request: BindAliasRequest, runtime: Util.RuntimeOptions): BindAliasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliasName)) {
    query['AliasName'] = request.aliasName;
  }
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAlias',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 绑定别名
 *
 * @param request BindAliasRequest
 * @return BindAliasResponse
 */
async function bindAlias(request: BindAliasRequest): BindAliasResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAliasWithOptions(request, runtime);
}

model BindPhoneRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='27725900'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='eb5f741d83d04d34807d229999eefa52'),
  phoneNumber?: string(name='PhoneNumber', description='This parameter is required.', example='1381111****'),
}

model BindPhoneResponseBody = {
  requestId?: string(name='RequestId', example='0D1126F0-F8FF-513D-BAFA-F140447BDED4'),
}

model BindPhoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindPhoneResponseBody(name='body'),
}

/**
 * @summary 绑定手机号码
 *
 * @param request BindPhoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindPhoneResponse
 */
async function bindPhoneWithOptions(request: BindPhoneRequest, runtime: Util.RuntimeOptions): BindPhoneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindPhone',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 绑定手机号码
 *
 * @param request BindPhoneRequest
 * @return BindPhoneResponse
 */
async function bindPhone(request: BindPhoneRequest): BindPhoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindPhoneWithOptions(request, runtime);
}

model BindTagRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  clientKey?: string(name='ClientKey', description='This parameter is required.', example='e2ba19de97604f55b16557673****'),
  keyType?: string(name='KeyType', description='This parameter is required.', example='DEVICE'),
  tagName?: string(name='TagName', description='This parameter is required.', example='test_tag,test_tag2'),
}

model BindTagResponseBody = {
  requestId?: string(name='RequestId', example='82FD0A09-5BB8-40FB-8221-9A11FE92D620'),
}

model BindTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindTagResponseBody(name='body'),
}

/**
 * @summary 绑定标签
 *
 * @param request BindTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindTagResponse
 */
async function bindTagWithOptions(request: BindTagRequest, runtime: Util.RuntimeOptions): BindTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.clientKey)) {
    query['ClientKey'] = request.clientKey;
  }
  if (!Util.isUnset(request.keyType)) {
    query['KeyType'] = request.keyType;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindTag',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 绑定标签
 *
 * @param request BindTagRequest
 * @return BindTagResponse
 */
async function bindTag(request: BindTagRequest): BindTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindTagWithOptions(request, runtime);
}

model CancelPushRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  messageId?: long(name='MessageId', description='This parameter is required.', example='501029'),
}

model CancelPushResponseBody = {
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model CancelPushResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelPushResponseBody(name='body'),
}

/**
 * @summary 取消定时推送任务
 *
 * @param request CancelPushRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelPushResponse
 */
async function cancelPushWithOptions(request: CancelPushRequest, runtime: Util.RuntimeOptions): CancelPushResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.messageId)) {
    query['MessageId'] = request.messageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelPush',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 取消定时推送任务
 *
 * @param request CancelPushRequest
 * @return CancelPushResponse
 */
async function cancelPush(request: CancelPushRequest): CancelPushResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelPushWithOptions(request, runtime);
}

model CheckCertificateRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
}

model CheckCertificateResponseBody = {
  android?: boolean(name='Android', example='false'),
  developmentCertInfo?: {
    exipreTime?: long(name='ExipreTime', example='1470024000000'),
    status?: string(name='Status', example='EXPIRED'),
  }(name='DevelopmentCertInfo'),
  IOS?: boolean(name='IOS', example='true'),
  productionCertInfo?: {
    exipreTime?: long(name='ExipreTime', example='1764561600000'),
    status?: string(name='Status', example='OK'),
  }(name='ProductionCertInfo'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model CheckCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckCertificateResponseBody(name='body'),
}

/**
 * @param request CheckCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckCertificateResponse
 */
async function checkCertificateWithOptions(request: CheckCertificateRequest, runtime: Util.RuntimeOptions): CheckCertificateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckCertificate',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CheckCertificateRequest
 * @return CheckCertificateResponse
 */
async function checkCertificate(request: CheckCertificateRequest): CheckCertificateResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkCertificateWithOptions(request, runtime);
}

model CheckDeviceRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23419851'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='ae296f3b04a58a05b30c95f****'),
}

model CheckDeviceResponseBody = {
  available?: boolean(name='Available', example='ture'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model CheckDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckDeviceResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI CheckDevice is deprecated, please use Push::2016-08-01::CheckDevices instead.
 *
 * @summary 【废弃】验证设备有效性
 *
 * @param request CheckDeviceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckDeviceResponse
 */
// Deprecated
async function checkDeviceWithOptions(request: CheckDeviceRequest, runtime: Util.RuntimeOptions): CheckDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckDevice',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI CheckDevice is deprecated, please use Push::2016-08-01::CheckDevices instead.
 *
 * @summary 【废弃】验证设备有效性
 *
 * @param request CheckDeviceRequest
 * @return CheckDeviceResponse
 */
// Deprecated
async function checkDevice(request: CheckDeviceRequest): CheckDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkDeviceWithOptions(request, runtime);
}

model CheckDevicesRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23419851'),
  deviceIds?: string(name='DeviceIds', description='This parameter is required.', example='ae296f3b04a58a05b30c95f****,ae296f3b04a58a05b30c95f****,ae296f3b04a58a05b30c95f****'),
}

model CheckDevicesResponseBody = {
  deviceCheckInfos?: {
    deviceCheckInfo?: [ 
    {
      available?: boolean(name='Available', example='true'),
      deviceId?: string(name='DeviceId', example='ae296f3b04a58a05b30c95f****'),
    }
  ](name='DeviceCheckInfo')
  }(name='DeviceCheckInfos'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model CheckDevicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckDevicesResponseBody(name='body'),
}

/**
 * @summary 批量检查设备有效性
 *
 * @param request CheckDevicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckDevicesResponse
 */
async function checkDevicesWithOptions(request: CheckDevicesRequest, runtime: Util.RuntimeOptions): CheckDevicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceIds)) {
    query['DeviceIds'] = request.deviceIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckDevices',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 批量检查设备有效性
 *
 * @param request CheckDevicesRequest
 * @return CheckDevicesResponse
 */
async function checkDevices(request: CheckDevicesRequest): CheckDevicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkDevicesWithOptions(request, runtime);
}

model CompleteContinuouslyPushRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  messageId?: string(name='MessageId', description='This parameter is required.', example='4010290149170430'),
}

model CompleteContinuouslyPushResponseBody = {
  messageId?: string(name='MessageId', example='4010290149170430'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model CompleteContinuouslyPushResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CompleteContinuouslyPushResponseBody(name='body'),
}

/**
 * @summary 完成持续推送任务
 *
 * @param request CompleteContinuouslyPushRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CompleteContinuouslyPushResponse
 */
async function completeContinuouslyPushWithOptions(request: CompleteContinuouslyPushRequest, runtime: Util.RuntimeOptions): CompleteContinuouslyPushResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.messageId)) {
    query['MessageId'] = request.messageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CompleteContinuouslyPush',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 完成持续推送任务
 *
 * @param request CompleteContinuouslyPushRequest
 * @return CompleteContinuouslyPushResponse
 */
async function completeContinuouslyPush(request: CompleteContinuouslyPushRequest): CompleteContinuouslyPushResponse {
  var runtime = new Util.RuntimeOptions{};
  return completeContinuouslyPushWithOptions(request, runtime);
}

model ContinuouslyPushRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  messageId?: string(name='MessageId', description='This parameter is required.', example='500131'),
  target?: string(name='Target', description='This parameter is required.', example='DEVICE'),
  targetValue?: string(name='TargetValue', description='This parameter is required.', example='a692961a92534047ad3625****'),
}

model ContinuouslyPushResponseBody = {
  messageId?: string(name='MessageId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
  requestId?: string(name='RequestId', example='500131'),
}

model ContinuouslyPushResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ContinuouslyPushResponseBody(name='body'),
}

/**
 * @summary 持续推送
 *
 * @param request ContinuouslyPushRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ContinuouslyPushResponse
 */
async function continuouslyPushWithOptions(request: ContinuouslyPushRequest, runtime: Util.RuntimeOptions): ContinuouslyPushResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.messageId)) {
    query['MessageId'] = request.messageId;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.targetValue)) {
    query['TargetValue'] = request.targetValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ContinuouslyPush',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 持续推送
 *
 * @param request ContinuouslyPushRequest
 * @return ContinuouslyPushResponse
 */
async function continuouslyPush(request: ContinuouslyPushRequest): ContinuouslyPushResponse {
  var runtime = new Util.RuntimeOptions{};
  return continuouslyPushWithOptions(request, runtime);
}

model ListSummaryAppsResponseBody = {
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
  summaryAppInfos?: {
    summaryAppInfo?: [ 
    {
      appKey?: long(name='AppKey', example='23****07'),
      appName?: string(name='AppName', example='abc'),
    }
  ](name='SummaryAppInfo')
  }(name='SummaryAppInfos'),
}

model ListSummaryAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSummaryAppsResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI ListSummaryApps is deprecated, please use Mhub::2017-08-25::ListApps instead.
 *
 * @summary 【废弃】查询用户已创建的app列表
 *
 * @param request ListSummaryAppsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSummaryAppsResponse
 */
// Deprecated
async function listSummaryAppsWithOptions(runtime: Util.RuntimeOptions): ListSummaryAppsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListSummaryApps',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI ListSummaryApps is deprecated, please use Mhub::2017-08-25::ListApps instead.
 *
 * @summary 【废弃】查询用户已创建的app列表
 *
 * @return ListSummaryAppsResponse
 */
// Deprecated
async function listSummaryApps(): ListSummaryAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSummaryAppsWithOptions(runtime);
}

model ListTagsRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
}

model ListTagsResponseBody = {
  requestId?: string(name='RequestId', example='6EEF262B-EA7D-41DC-89B9-20F3D1E28194'),
  tagInfos?: {
    tagInfo?: [ 
    {
      tagName?: string(name='TagName', example='test_tag2'),
    }
  ](name='TagInfo')
  }(name='TagInfos'),
}

model ListTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagsResponseBody(name='body'),
}

/**
 * @summary 获取标签列表
 *
 * @param request ListTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagsResponse
 */
async function listTagsWithOptions(request: ListTagsRequest, runtime: Util.RuntimeOptions): ListTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTags',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取标签列表
 *
 * @param request ListTagsRequest
 * @return ListTagsResponse
 */
async function listTags(request: ListTagsRequest): ListTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagsWithOptions(request, runtime);
}

model MassPushRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  idempotentToken?: string(name='IdempotentToken'),
  pushTask?: [ 
    {
      androidActivity?: string(name='AndroidActivity', example='com.alibaba.cloudpushdemo.bizactivity'),
      androidBadgeAddNum?: int32(name='AndroidBadgeAddNum', example='99'),
      androidBadgeClass?: string(name='AndroidBadgeClass'),
      androidBadgeSetNum?: int32(name='AndroidBadgeSetNum', example='99'),
      androidBigBody?: string(name='AndroidBigBody'),
      androidBigPictureUrl?: string(name='AndroidBigPictureUrl', example='https://imag.example.com/image.png'),
      androidBigTitle?: string(name='AndroidBigTitle'),
      androidExtParameters?: string(name='AndroidExtParameters', example='{"key1":"value1","api_name":"PushNoticeToAndroidRequest"}'),
      androidHonorTargetUserType?: int32(name='AndroidHonorTargetUserType'),
      androidHuaweiReceiptId?: string(name='AndroidHuaweiReceiptId', example='RCP4C123456'),
      androidHuaweiTargetUserType?: int32(name='AndroidHuaweiTargetUserType', example='1'),
      androidImageUrl?: string(name='AndroidImageUrl', example='https://imag.example.com/image.png'),
      androidInboxBody?: string(name='AndroidInboxBody'),
      androidMessageHuaweiCategory?: string(name='AndroidMessageHuaweiCategory', example='VOIP'),
      androidMessageHuaweiUrgency?: string(name='AndroidMessageHuaweiUrgency', example='HIGH'),
      androidMessageOppoCategory?: string(name='AndroidMessageOppoCategory'),
      androidMessageOppoNotifyLevel?: int32(name='AndroidMessageOppoNotifyLevel'),
      androidMessageVivoCategory?: string(name='AndroidMessageVivoCategory', example='TODO'),
      androidMusic?: string(name='AndroidMusic'),
      androidNotificationBarPriority?: int32(name='AndroidNotificationBarPriority', example='0'),
      androidNotificationBarType?: int32(name='AndroidNotificationBarType', example='2'),
      androidNotificationChannel?: string(name='AndroidNotificationChannel', example='1'),
      androidNotificationGroup?: string(name='AndroidNotificationGroup', example='group-1'),
      androidNotificationHonorChannel?: string(name='AndroidNotificationHonorChannel', example='LOW'),
      androidNotificationHuaweiChannel?: string(name='AndroidNotificationHuaweiChannel', example='LOW'),
      androidNotificationNotifyId?: int32(name='AndroidNotificationNotifyId', example='100001'),
      androidNotificationThreadId?: string(name='AndroidNotificationThreadId'),
      androidNotificationVivoChannel?: string(name='AndroidNotificationVivoChannel', example='0'),
      androidNotificationXiaomiChannel?: string(name='AndroidNotificationXiaomiChannel', example='michannel'),
      androidNotifyType?: string(name='AndroidNotifyType', example='VIBRATE'),
      androidOpenType?: string(name='AndroidOpenType', example='APPLICATION'),
      androidOpenUrl?: string(name='AndroidOpenUrl', example='https://xxxx.xxx'),
      androidPopupActivity?: string(name='AndroidPopupActivity', example='com.alibaba.cloudpushdemo.bizactivity'),
      androidPopupBody?: string(name='AndroidPopupBody', example='hello'),
      androidPopupTitle?: string(name='AndroidPopupTitle', example='hello'),
      androidRemind?: boolean(name='AndroidRemind', example='true'),
      androidRenderStyle?: string(name='AndroidRenderStyle', example='1'),
      androidTargetUserType?: int32(name='AndroidTargetUserType'),
      androidVivoPushMode?: int32(name='AndroidVivoPushMode', example='1'),
      androidVivoReceiptId?: string(name='AndroidVivoReceiptId'),
      androidXiaoMiActivity?: string(name='AndroidXiaoMiActivity', deprecated=true),
      androidXiaoMiNotifyBody?: string(name='AndroidXiaoMiNotifyBody', deprecated=true),
      androidXiaoMiNotifyTitle?: string(name='AndroidXiaoMiNotifyTitle', deprecated=true),
      androidXiaomiBigPictureUrl?: string(name='AndroidXiaomiBigPictureUrl', example='https://f6.market.xiaomi.com/download/MiPass/aaa/bbb.png', deprecated=true),
      androidXiaomiImageUrl?: string(name='AndroidXiaomiImageUrl', example='https://imag.example.com/image.png', deprecated=true),
      body?: string(name='Body', example='hello'),
      deviceType?: string(name='DeviceType', description='This parameter is required.', example='ALL'),
      expireTime?: string(name='ExpireTime', example='2019-02-20T00:00:00Z'),
      harmonyAction?: string(name='HarmonyAction'),
      harmonyActionType?: string(name='HarmonyActionType'),
      harmonyBadgeAddNum?: int32(name='HarmonyBadgeAddNum'),
      harmonyBadgeSetNum?: int32(name='HarmonyBadgeSetNum'),
      harmonyCategory?: string(name='HarmonyCategory'),
      harmonyExtParameters?: string(name='HarmonyExtParameters'),
      harmonyExtensionExtraData?: string(name='HarmonyExtensionExtraData'),
      harmonyExtensionPush?: boolean(name='HarmonyExtensionPush'),
      harmonyImageUrl?: string(name='HarmonyImageUrl'),
      harmonyInboxContent?: string(name='HarmonyInboxContent'),
      harmonyNotificationSlotType?: string(name='HarmonyNotificationSlotType'),
      harmonyNotifyId?: int32(name='HarmonyNotifyId'),
      harmonyReceiptId?: string(name='HarmonyReceiptId'),
      harmonyRemind?: boolean(name='HarmonyRemind'),
      harmonyRemindBody?: string(name='HarmonyRemindBody'),
      harmonyRemindTitle?: string(name='HarmonyRemindTitle'),
      harmonyRenderStyle?: string(name='HarmonyRenderStyle'),
      harmonyTestMessage?: boolean(name='HarmonyTestMessage'),
      harmonyUri?: string(name='HarmonyUri'),
      jobKey?: string(name='JobKey', example='123'),
      pushTime?: string(name='PushTime', example='2019-02-20T00:00:00Z'),
      pushType?: string(name='PushType', description='This parameter is required.', example='MESSAGE'),
      sendChannels?: string(name='SendChannels', example='accs,huawei,xiaomi'),
      sendSpeed?: int32(name='SendSpeed', example='0', deprecated=true),
      storeOffline?: boolean(name='StoreOffline', example='true'),
      target?: string(name='Target', description='This parameter is required.', example='DEVICE'),
      targetValue?: string(name='TargetValue', description='This parameter is required.', example='deviceid1,deviceid2'),
      title?: string(name='Title', example='title'),
      trim?: boolean(name='Trim', example='false'),
      iOSApnsEnv?: string(name='iOSApnsEnv', example='DEV'),
      iOSBadge?: int32(name='iOSBadge', example='0'),
      iOSBadgeAutoIncrement?: boolean(name='iOSBadgeAutoIncrement', example='true'),
      iOSExtParameters?: string(name='iOSExtParameters', example='{“attachment”: “https://xxxx.xxx/notification_pic.png"}'),
      iOSInterruptionLevel?: string(name='iOSInterruptionLevel', example='active'),
      iOSLiveActivityAttributes?: string(name='iOSLiveActivityAttributes'),
      iOSLiveActivityAttributesType?: string(name='iOSLiveActivityAttributesType'),
      iOSLiveActivityContentState?: string(name='iOSLiveActivityContentState'),
      iOSLiveActivityDismissalDate?: long(name='iOSLiveActivityDismissalDate'),
      iOSLiveActivityEvent?: string(name='iOSLiveActivityEvent'),
      iOSLiveActivityId?: string(name='iOSLiveActivityId'),
      iOSLiveActivityStaleDate?: long(name='iOSLiveActivityStaleDate'),
      iOSMusic?: string(name='iOSMusic', example='””'),
      iOSMutableContent?: boolean(name='iOSMutableContent', example='true'),
      iOSNotificationCategory?: string(name='iOSNotificationCategory', example='ios'),
      iOSNotificationCollapseId?: string(name='iOSNotificationCollapseId', example='ZD2011'),
      iOSNotificationThreadId?: string(name='iOSNotificationThreadId', example='abc'),
      iOSRelevanceScore?: double(name='iOSRelevanceScore', example='0.01'),
      iOSRemind?: boolean(name='iOSRemind', example='true'),
      iOSRemindBody?: string(name='iOSRemindBody'),
      iOSSilentNotification?: boolean(name='iOSSilentNotification', example='true'),
      iOSSubtitle?: string(name='iOSSubtitle', example='subtitle'),
    }
  ](name='PushTask', description='This parameter is required.'),
}

model MassPushResponseBody = {
  messageIds?: {
    messageId?: [ string ](name='MessageId')
  }(name='MessageIds'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model MassPushResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MassPushResponseBody(name='body'),
}

/**
 * @summary 批量推送
 *
 * @param request MassPushRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MassPushResponse
 */
async function massPushWithOptions(request: MassPushRequest, runtime: Util.RuntimeOptions): MassPushResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.idempotentToken)) {
    query['IdempotentToken'] = request.idempotentToken;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.pushTask)) {
    body['PushTask'] = request.pushTask;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'MassPush',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 批量推送
 *
 * @param request MassPushRequest
 * @return MassPushResponse
 */
async function massPush(request: MassPushRequest): MassPushResponse {
  var runtime = new Util.RuntimeOptions{};
  return massPushWithOptions(request, runtime);
}

model PushRequest {
  androidActivity?: string(name='AndroidActivity', example='com.alibaba.cloudpushdemo.bizactivity'),
  androidBadgeAddNum?: int32(name='AndroidBadgeAddNum'),
  androidBadgeClass?: string(name='AndroidBadgeClass'),
  androidBadgeSetNum?: int32(name='AndroidBadgeSetNum'),
  androidBigBody?: string(name='AndroidBigBody'),
  androidBigPictureUrl?: string(name='AndroidBigPictureUrl', example='https://imag.example.com/image.png'),
  androidBigTitle?: string(name='AndroidBigTitle'),
  androidExtParameters?: string(name='AndroidExtParameters', example='{"key1":"value1","api_name":"PushNoticeToAndroidRequest"}'),
  androidHonorTargetUserType?: int32(name='AndroidHonorTargetUserType'),
  androidHuaweiReceiptId?: string(name='AndroidHuaweiReceiptId', example='RCP4C123456'),
  androidHuaweiTargetUserType?: int32(name='AndroidHuaweiTargetUserType', example='0'),
  androidImageUrl?: string(name='AndroidImageUrl', example='https://imag.example.com/image.png'),
  androidInboxBody?: string(name='AndroidInboxBody'),
  androidMessageHuaweiCategory?: string(name='AndroidMessageHuaweiCategory', example='VOIP'),
  androidMessageHuaweiUrgency?: string(name='AndroidMessageHuaweiUrgency', example='HIGH'),
  androidMessageOppoCategory?: string(name='AndroidMessageOppoCategory'),
  androidMessageOppoNotifyLevel?: int32(name='AndroidMessageOppoNotifyLevel'),
  androidMessageVivoCategory?: string(name='AndroidMessageVivoCategory', example='TODO'),
  androidMusic?: string(name='AndroidMusic'),
  androidNotificationBarPriority?: int32(name='AndroidNotificationBarPriority', example='0'),
  androidNotificationBarType?: int32(name='AndroidNotificationBarType', example='2'),
  androidNotificationChannel?: string(name='AndroidNotificationChannel', example='1'),
  androidNotificationGroup?: string(name='AndroidNotificationGroup', example='group-1'),
  androidNotificationHonorChannel?: string(name='AndroidNotificationHonorChannel', example='LOW'),
  androidNotificationHuaweiChannel?: string(name='AndroidNotificationHuaweiChannel', example='LOW'),
  androidNotificationNotifyId?: int32(name='AndroidNotificationNotifyId', example='100001'),
  androidNotificationThreadId?: string(name='AndroidNotificationThreadId'),
  androidNotificationVivoChannel?: string(name='AndroidNotificationVivoChannel', example='classification'),
  androidNotificationXiaomiChannel?: string(name='AndroidNotificationXiaomiChannel', example='michannel'),
  androidNotifyType?: string(name='AndroidNotifyType', example='BOTH'),
  androidOpenType?: string(name='AndroidOpenType', example='APPLICATION'),
  androidOpenUrl?: string(name='AndroidOpenUrl', example='https://xxxx.xxx'),
  androidPopupActivity?: string(name='AndroidPopupActivity', example='com.alibaba.cloudpushdemo.bizactivity'),
  androidPopupBody?: string(name='AndroidPopupBody', example='hello'),
  androidPopupTitle?: string(name='AndroidPopupTitle', example='hello'),
  androidRemind?: boolean(name='AndroidRemind', example='true'),
  androidRenderStyle?: int32(name='AndroidRenderStyle', example='1'),
  androidTargetUserType?: int32(name='AndroidTargetUserType'),
  androidVivoPushMode?: int32(name='AndroidVivoPushMode', example='0'),
  androidVivoReceiptId?: string(name='AndroidVivoReceiptId'),
  androidXiaoMiActivity?: string(name='AndroidXiaoMiActivity', deprecated=true),
  androidXiaoMiNotifyBody?: string(name='AndroidXiaoMiNotifyBody', deprecated=true),
  androidXiaoMiNotifyTitle?: string(name='AndroidXiaoMiNotifyTitle', deprecated=true),
  androidXiaomiBigPictureUrl?: string(name='AndroidXiaomiBigPictureUrl', example='https://f6.market.xiaomi.com/download/MiPass/aaa/bbb.png', deprecated=true),
  androidXiaomiImageUrl?: string(name='AndroidXiaomiImageUrl', example='https://imag.example.com/image.png', deprecated=true),
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  body?: string(name='Body', example='hello'),
  deviceType?: string(name='DeviceType', description='This parameter is required.', example='ALL'),
  expireTime?: string(name='ExpireTime', example='2019-02-20T00:00:00Z'),
  harmonyAction?: string(name='HarmonyAction'),
  harmonyActionType?: string(name='HarmonyActionType'),
  harmonyBadgeAddNum?: int32(name='HarmonyBadgeAddNum'),
  harmonyBadgeSetNum?: int32(name='HarmonyBadgeSetNum'),
  harmonyCategory?: string(name='HarmonyCategory'),
  harmonyExtParameters?: string(name='HarmonyExtParameters'),
  harmonyExtensionExtraData?: string(name='HarmonyExtensionExtraData'),
  harmonyExtensionPush?: boolean(name='HarmonyExtensionPush'),
  harmonyImageUrl?: string(name='HarmonyImageUrl'),
  harmonyInboxContent?: string(name='HarmonyInboxContent'),
  harmonyNotificationSlotType?: string(name='HarmonyNotificationSlotType'),
  harmonyNotifyId?: int32(name='HarmonyNotifyId'),
  harmonyReceiptId?: string(name='HarmonyReceiptId'),
  harmonyRemind?: boolean(name='HarmonyRemind'),
  harmonyRemindBody?: string(name='HarmonyRemindBody'),
  harmonyRemindTitle?: string(name='HarmonyRemindTitle'),
  harmonyRenderStyle?: string(name='HarmonyRenderStyle'),
  harmonyTestMessage?: boolean(name='HarmonyTestMessage'),
  harmonyUri?: string(name='HarmonyUri'),
  idempotentToken?: string(name='IdempotentToken'),
  jobKey?: string(name='JobKey', example='123'),
  pushTime?: string(name='PushTime', example='2019-02-20T00:00:00Z'),
  pushType?: string(name='PushType', description='This parameter is required.', example='MESSAGE'),
  sendChannels?: string(name='SendChannels', example='accs,huawei,xiaomi'),
  sendSpeed?: int32(name='SendSpeed', example='0', deprecated=true),
  smsDelaySecs?: int32(name='SmsDelaySecs', example='15'),
  smsParams?: string(name='SmsParams', example='key1=value1'),
  smsSendPolicy?: int32(name='SmsSendPolicy', example='0'),
  smsSignName?: string(name='SmsSignName'),
  smsTemplateName?: string(name='SmsTemplateName'),
  storeOffline?: boolean(name='StoreOffline', example='false'),
  target?: string(name='Target', description='This parameter is required.', example='ALL'),
  targetValue?: string(name='TargetValue', description='This parameter is required.', example='ALL'),
  title?: string(name='Title', example='title'),
  trim?: boolean(name='Trim', example='false'),
  iOSApnsEnv?: string(name='iOSApnsEnv', example='DEV'),
  iOSBadge?: int32(name='iOSBadge', example='0'),
  iOSBadgeAutoIncrement?: boolean(name='iOSBadgeAutoIncrement', example='true'),
  iOSExtParameters?: string(name='iOSExtParameters', example='{“attachment”: “https://xxxx.xxx/notification_pic.png"}'),
  iOSInterruptionLevel?: string(name='iOSInterruptionLevel', example='active'),
  iOSLiveActivityAttributes?: string(name='iOSLiveActivityAttributes'),
  iOSLiveActivityAttributesType?: string(name='iOSLiveActivityAttributesType'),
  iOSLiveActivityContentState?: string(name='iOSLiveActivityContentState'),
  iOSLiveActivityDismissalDate?: long(name='iOSLiveActivityDismissalDate'),
  iOSLiveActivityEvent?: string(name='iOSLiveActivityEvent'),
  iOSLiveActivityId?: string(name='iOSLiveActivityId'),
  iOSLiveActivityStaleDate?: long(name='iOSLiveActivityStaleDate'),
  iOSMusic?: string(name='iOSMusic', example='""'),
  iOSMutableContent?: boolean(name='iOSMutableContent', example='true'),
  iOSNotificationCategory?: string(name='iOSNotificationCategory', example='ios'),
  iOSNotificationCollapseId?: string(name='iOSNotificationCollapseId', example='ZD2011'),
  iOSNotificationThreadId?: string(name='iOSNotificationThreadId', example='abc'),
  iOSRelevanceScore?: double(name='iOSRelevanceScore', example='0.01'),
  iOSRemind?: boolean(name='iOSRemind', example='true'),
  iOSRemindBody?: string(name='iOSRemindBody'),
  iOSSilentNotification?: boolean(name='iOSSilentNotification', example='true'),
  iOSSubtitle?: string(name='iOSSubtitle', example='su\\\\"b'),
}

model PushResponseBody = {
  messageId?: string(name='MessageId', example='501029'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model PushResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushResponseBody(name='body'),
}

/**
 * @summary 高级推送接口
 *
 * @param request PushRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushResponse
 */
async function pushWithOptions(request: PushRequest, runtime: Util.RuntimeOptions): PushResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidActivity)) {
    query['AndroidActivity'] = request.androidActivity;
  }
  if (!Util.isUnset(request.androidBadgeAddNum)) {
    query['AndroidBadgeAddNum'] = request.androidBadgeAddNum;
  }
  if (!Util.isUnset(request.androidBadgeClass)) {
    query['AndroidBadgeClass'] = request.androidBadgeClass;
  }
  if (!Util.isUnset(request.androidBadgeSetNum)) {
    query['AndroidBadgeSetNum'] = request.androidBadgeSetNum;
  }
  if (!Util.isUnset(request.androidBigBody)) {
    query['AndroidBigBody'] = request.androidBigBody;
  }
  if (!Util.isUnset(request.androidBigPictureUrl)) {
    query['AndroidBigPictureUrl'] = request.androidBigPictureUrl;
  }
  if (!Util.isUnset(request.androidBigTitle)) {
    query['AndroidBigTitle'] = request.androidBigTitle;
  }
  if (!Util.isUnset(request.androidExtParameters)) {
    query['AndroidExtParameters'] = request.androidExtParameters;
  }
  if (!Util.isUnset(request.androidHonorTargetUserType)) {
    query['AndroidHonorTargetUserType'] = request.androidHonorTargetUserType;
  }
  if (!Util.isUnset(request.androidHuaweiReceiptId)) {
    query['AndroidHuaweiReceiptId'] = request.androidHuaweiReceiptId;
  }
  if (!Util.isUnset(request.androidHuaweiTargetUserType)) {
    query['AndroidHuaweiTargetUserType'] = request.androidHuaweiTargetUserType;
  }
  if (!Util.isUnset(request.androidImageUrl)) {
    query['AndroidImageUrl'] = request.androidImageUrl;
  }
  if (!Util.isUnset(request.androidInboxBody)) {
    query['AndroidInboxBody'] = request.androidInboxBody;
  }
  if (!Util.isUnset(request.androidMessageHuaweiCategory)) {
    query['AndroidMessageHuaweiCategory'] = request.androidMessageHuaweiCategory;
  }
  if (!Util.isUnset(request.androidMessageHuaweiUrgency)) {
    query['AndroidMessageHuaweiUrgency'] = request.androidMessageHuaweiUrgency;
  }
  if (!Util.isUnset(request.androidMessageOppoCategory)) {
    query['AndroidMessageOppoCategory'] = request.androidMessageOppoCategory;
  }
  if (!Util.isUnset(request.androidMessageOppoNotifyLevel)) {
    query['AndroidMessageOppoNotifyLevel'] = request.androidMessageOppoNotifyLevel;
  }
  if (!Util.isUnset(request.androidMessageVivoCategory)) {
    query['AndroidMessageVivoCategory'] = request.androidMessageVivoCategory;
  }
  if (!Util.isUnset(request.androidMusic)) {
    query['AndroidMusic'] = request.androidMusic;
  }
  if (!Util.isUnset(request.androidNotificationBarPriority)) {
    query['AndroidNotificationBarPriority'] = request.androidNotificationBarPriority;
  }
  if (!Util.isUnset(request.androidNotificationBarType)) {
    query['AndroidNotificationBarType'] = request.androidNotificationBarType;
  }
  if (!Util.isUnset(request.androidNotificationChannel)) {
    query['AndroidNotificationChannel'] = request.androidNotificationChannel;
  }
  if (!Util.isUnset(request.androidNotificationGroup)) {
    query['AndroidNotificationGroup'] = request.androidNotificationGroup;
  }
  if (!Util.isUnset(request.androidNotificationHonorChannel)) {
    query['AndroidNotificationHonorChannel'] = request.androidNotificationHonorChannel;
  }
  if (!Util.isUnset(request.androidNotificationHuaweiChannel)) {
    query['AndroidNotificationHuaweiChannel'] = request.androidNotificationHuaweiChannel;
  }
  if (!Util.isUnset(request.androidNotificationNotifyId)) {
    query['AndroidNotificationNotifyId'] = request.androidNotificationNotifyId;
  }
  if (!Util.isUnset(request.androidNotificationThreadId)) {
    query['AndroidNotificationThreadId'] = request.androidNotificationThreadId;
  }
  if (!Util.isUnset(request.androidNotificationVivoChannel)) {
    query['AndroidNotificationVivoChannel'] = request.androidNotificationVivoChannel;
  }
  if (!Util.isUnset(request.androidNotificationXiaomiChannel)) {
    query['AndroidNotificationXiaomiChannel'] = request.androidNotificationXiaomiChannel;
  }
  if (!Util.isUnset(request.androidNotifyType)) {
    query['AndroidNotifyType'] = request.androidNotifyType;
  }
  if (!Util.isUnset(request.androidOpenType)) {
    query['AndroidOpenType'] = request.androidOpenType;
  }
  if (!Util.isUnset(request.androidOpenUrl)) {
    query['AndroidOpenUrl'] = request.androidOpenUrl;
  }
  if (!Util.isUnset(request.androidPopupActivity)) {
    query['AndroidPopupActivity'] = request.androidPopupActivity;
  }
  if (!Util.isUnset(request.androidPopupBody)) {
    query['AndroidPopupBody'] = request.androidPopupBody;
  }
  if (!Util.isUnset(request.androidPopupTitle)) {
    query['AndroidPopupTitle'] = request.androidPopupTitle;
  }
  if (!Util.isUnset(request.androidRemind)) {
    query['AndroidRemind'] = request.androidRemind;
  }
  if (!Util.isUnset(request.androidRenderStyle)) {
    query['AndroidRenderStyle'] = request.androidRenderStyle;
  }
  if (!Util.isUnset(request.androidTargetUserType)) {
    query['AndroidTargetUserType'] = request.androidTargetUserType;
  }
  if (!Util.isUnset(request.androidVivoPushMode)) {
    query['AndroidVivoPushMode'] = request.androidVivoPushMode;
  }
  if (!Util.isUnset(request.androidVivoReceiptId)) {
    query['AndroidVivoReceiptId'] = request.androidVivoReceiptId;
  }
  if (!Util.isUnset(request.androidXiaoMiActivity)) {
    query['AndroidXiaoMiActivity'] = request.androidXiaoMiActivity;
  }
  if (!Util.isUnset(request.androidXiaoMiNotifyBody)) {
    query['AndroidXiaoMiNotifyBody'] = request.androidXiaoMiNotifyBody;
  }
  if (!Util.isUnset(request.androidXiaoMiNotifyTitle)) {
    query['AndroidXiaoMiNotifyTitle'] = request.androidXiaoMiNotifyTitle;
  }
  if (!Util.isUnset(request.androidXiaomiBigPictureUrl)) {
    query['AndroidXiaomiBigPictureUrl'] = request.androidXiaomiBigPictureUrl;
  }
  if (!Util.isUnset(request.androidXiaomiImageUrl)) {
    query['AndroidXiaomiImageUrl'] = request.androidXiaomiImageUrl;
  }
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.body)) {
    query['Body'] = request.body;
  }
  if (!Util.isUnset(request.deviceType)) {
    query['DeviceType'] = request.deviceType;
  }
  if (!Util.isUnset(request.expireTime)) {
    query['ExpireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.harmonyAction)) {
    query['HarmonyAction'] = request.harmonyAction;
  }
  if (!Util.isUnset(request.harmonyActionType)) {
    query['HarmonyActionType'] = request.harmonyActionType;
  }
  if (!Util.isUnset(request.harmonyBadgeAddNum)) {
    query['HarmonyBadgeAddNum'] = request.harmonyBadgeAddNum;
  }
  if (!Util.isUnset(request.harmonyBadgeSetNum)) {
    query['HarmonyBadgeSetNum'] = request.harmonyBadgeSetNum;
  }
  if (!Util.isUnset(request.harmonyCategory)) {
    query['HarmonyCategory'] = request.harmonyCategory;
  }
  if (!Util.isUnset(request.harmonyExtParameters)) {
    query['HarmonyExtParameters'] = request.harmonyExtParameters;
  }
  if (!Util.isUnset(request.harmonyExtensionExtraData)) {
    query['HarmonyExtensionExtraData'] = request.harmonyExtensionExtraData;
  }
  if (!Util.isUnset(request.harmonyExtensionPush)) {
    query['HarmonyExtensionPush'] = request.harmonyExtensionPush;
  }
  if (!Util.isUnset(request.harmonyImageUrl)) {
    query['HarmonyImageUrl'] = request.harmonyImageUrl;
  }
  if (!Util.isUnset(request.harmonyInboxContent)) {
    query['HarmonyInboxContent'] = request.harmonyInboxContent;
  }
  if (!Util.isUnset(request.harmonyNotificationSlotType)) {
    query['HarmonyNotificationSlotType'] = request.harmonyNotificationSlotType;
  }
  if (!Util.isUnset(request.harmonyNotifyId)) {
    query['HarmonyNotifyId'] = request.harmonyNotifyId;
  }
  if (!Util.isUnset(request.harmonyReceiptId)) {
    query['HarmonyReceiptId'] = request.harmonyReceiptId;
  }
  if (!Util.isUnset(request.harmonyRemind)) {
    query['HarmonyRemind'] = request.harmonyRemind;
  }
  if (!Util.isUnset(request.harmonyRemindBody)) {
    query['HarmonyRemindBody'] = request.harmonyRemindBody;
  }
  if (!Util.isUnset(request.harmonyRemindTitle)) {
    query['HarmonyRemindTitle'] = request.harmonyRemindTitle;
  }
  if (!Util.isUnset(request.harmonyRenderStyle)) {
    query['HarmonyRenderStyle'] = request.harmonyRenderStyle;
  }
  if (!Util.isUnset(request.harmonyTestMessage)) {
    query['HarmonyTestMessage'] = request.harmonyTestMessage;
  }
  if (!Util.isUnset(request.harmonyUri)) {
    query['HarmonyUri'] = request.harmonyUri;
  }
  if (!Util.isUnset(request.idempotentToken)) {
    query['IdempotentToken'] = request.idempotentToken;
  }
  if (!Util.isUnset(request.jobKey)) {
    query['JobKey'] = request.jobKey;
  }
  if (!Util.isUnset(request.pushTime)) {
    query['PushTime'] = request.pushTime;
  }
  if (!Util.isUnset(request.pushType)) {
    query['PushType'] = request.pushType;
  }
  if (!Util.isUnset(request.sendChannels)) {
    query['SendChannels'] = request.sendChannels;
  }
  if (!Util.isUnset(request.sendSpeed)) {
    query['SendSpeed'] = request.sendSpeed;
  }
  if (!Util.isUnset(request.smsDelaySecs)) {
    query['SmsDelaySecs'] = request.smsDelaySecs;
  }
  if (!Util.isUnset(request.smsParams)) {
    query['SmsParams'] = request.smsParams;
  }
  if (!Util.isUnset(request.smsSendPolicy)) {
    query['SmsSendPolicy'] = request.smsSendPolicy;
  }
  if (!Util.isUnset(request.smsSignName)) {
    query['SmsSignName'] = request.smsSignName;
  }
  if (!Util.isUnset(request.smsTemplateName)) {
    query['SmsTemplateName'] = request.smsTemplateName;
  }
  if (!Util.isUnset(request.storeOffline)) {
    query['StoreOffline'] = request.storeOffline;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.targetValue)) {
    query['TargetValue'] = request.targetValue;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  if (!Util.isUnset(request.trim)) {
    query['Trim'] = request.trim;
  }
  if (!Util.isUnset(request.iOSApnsEnv)) {
    query['iOSApnsEnv'] = request.iOSApnsEnv;
  }
  if (!Util.isUnset(request.iOSBadge)) {
    query['iOSBadge'] = request.iOSBadge;
  }
  if (!Util.isUnset(request.iOSBadgeAutoIncrement)) {
    query['iOSBadgeAutoIncrement'] = request.iOSBadgeAutoIncrement;
  }
  if (!Util.isUnset(request.iOSExtParameters)) {
    query['iOSExtParameters'] = request.iOSExtParameters;
  }
  if (!Util.isUnset(request.iOSInterruptionLevel)) {
    query['iOSInterruptionLevel'] = request.iOSInterruptionLevel;
  }
  if (!Util.isUnset(request.iOSLiveActivityAttributes)) {
    query['iOSLiveActivityAttributes'] = request.iOSLiveActivityAttributes;
  }
  if (!Util.isUnset(request.iOSLiveActivityAttributesType)) {
    query['iOSLiveActivityAttributesType'] = request.iOSLiveActivityAttributesType;
  }
  if (!Util.isUnset(request.iOSLiveActivityContentState)) {
    query['iOSLiveActivityContentState'] = request.iOSLiveActivityContentState;
  }
  if (!Util.isUnset(request.iOSLiveActivityDismissalDate)) {
    query['iOSLiveActivityDismissalDate'] = request.iOSLiveActivityDismissalDate;
  }
  if (!Util.isUnset(request.iOSLiveActivityEvent)) {
    query['iOSLiveActivityEvent'] = request.iOSLiveActivityEvent;
  }
  if (!Util.isUnset(request.iOSLiveActivityId)) {
    query['iOSLiveActivityId'] = request.iOSLiveActivityId;
  }
  if (!Util.isUnset(request.iOSLiveActivityStaleDate)) {
    query['iOSLiveActivityStaleDate'] = request.iOSLiveActivityStaleDate;
  }
  if (!Util.isUnset(request.iOSMusic)) {
    query['iOSMusic'] = request.iOSMusic;
  }
  if (!Util.isUnset(request.iOSMutableContent)) {
    query['iOSMutableContent'] = request.iOSMutableContent;
  }
  if (!Util.isUnset(request.iOSNotificationCategory)) {
    query['iOSNotificationCategory'] = request.iOSNotificationCategory;
  }
  if (!Util.isUnset(request.iOSNotificationCollapseId)) {
    query['iOSNotificationCollapseId'] = request.iOSNotificationCollapseId;
  }
  if (!Util.isUnset(request.iOSNotificationThreadId)) {
    query['iOSNotificationThreadId'] = request.iOSNotificationThreadId;
  }
  if (!Util.isUnset(request.iOSRelevanceScore)) {
    query['iOSRelevanceScore'] = request.iOSRelevanceScore;
  }
  if (!Util.isUnset(request.iOSRemind)) {
    query['iOSRemind'] = request.iOSRemind;
  }
  if (!Util.isUnset(request.iOSRemindBody)) {
    query['iOSRemindBody'] = request.iOSRemindBody;
  }
  if (!Util.isUnset(request.iOSSilentNotification)) {
    query['iOSSilentNotification'] = request.iOSSilentNotification;
  }
  if (!Util.isUnset(request.iOSSubtitle)) {
    query['iOSSubtitle'] = request.iOSSubtitle;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Push',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 高级推送接口
 *
 * @param request PushRequest
 * @return PushResponse
 */
async function push(request: PushRequest): PushResponse {
  var runtime = new Util.RuntimeOptions{};
  return pushWithOptions(request, runtime);
}

model PushMessageToAndroidRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  body?: string(name='Body', description='This parameter is required.', example='my body'),
  jobKey?: string(name='JobKey', example='123'),
  storeOffline?: boolean(name='StoreOffline'),
  target?: string(name='Target', description='This parameter is required.', example='ALL'),
  targetValue?: string(name='TargetValue', description='This parameter is required.', example='all'),
  title?: string(name='Title', description='This parameter is required.', example='my title'),
}

model PushMessageToAndroidResponseBody = {
  messageId?: string(name='MessageId', example='501029'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model PushMessageToAndroidResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushMessageToAndroidResponseBody(name='body'),
}

/**
 * @summary 推送消息给Android设备
 *
 * @param request PushMessageToAndroidRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushMessageToAndroidResponse
 */
async function pushMessageToAndroidWithOptions(request: PushMessageToAndroidRequest, runtime: Util.RuntimeOptions): PushMessageToAndroidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.body)) {
    query['Body'] = request.body;
  }
  if (!Util.isUnset(request.jobKey)) {
    query['JobKey'] = request.jobKey;
  }
  if (!Util.isUnset(request.storeOffline)) {
    query['StoreOffline'] = request.storeOffline;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.targetValue)) {
    query['TargetValue'] = request.targetValue;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PushMessageToAndroid',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 推送消息给Android设备
 *
 * @param request PushMessageToAndroidRequest
 * @return PushMessageToAndroidResponse
 */
async function pushMessageToAndroid(request: PushMessageToAndroidRequest): PushMessageToAndroidResponse {
  var runtime = new Util.RuntimeOptions{};
  return pushMessageToAndroidWithOptions(request, runtime);
}

model PushMessageToiOSRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='24780725'),
  body?: string(name='Body', description='This parameter is required.', example='my body'),
  jobKey?: string(name='JobKey', example='123'),
  storeOffline?: boolean(name='StoreOffline'),
  target?: string(name='Target', description='This parameter is required.', example='ALL'),
  targetValue?: string(name='TargetValue', description='This parameter is required.', example='all'),
  title?: string(name='Title', description='This parameter is required.', example='my title'),
}

model PushMessageToiOSResponseBody = {
  messageId?: string(name='MessageId', example='501029'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model PushMessageToiOSResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushMessageToiOSResponseBody(name='body'),
}

/**
 * @summary 推送消息给iOS设备
 *
 * @param request PushMessageToiOSRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushMessageToiOSResponse
 */
async function pushMessageToiOSWithOptions(request: PushMessageToiOSRequest, runtime: Util.RuntimeOptions): PushMessageToiOSResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.body)) {
    query['Body'] = request.body;
  }
  if (!Util.isUnset(request.jobKey)) {
    query['JobKey'] = request.jobKey;
  }
  if (!Util.isUnset(request.storeOffline)) {
    query['StoreOffline'] = request.storeOffline;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.targetValue)) {
    query['TargetValue'] = request.targetValue;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PushMessageToiOS',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 推送消息给iOS设备
 *
 * @param request PushMessageToiOSRequest
 * @return PushMessageToiOSResponse
 */
async function pushMessageToiOS(request: PushMessageToiOSRequest): PushMessageToiOSResponse {
  var runtime = new Util.RuntimeOptions{};
  return pushMessageToiOSWithOptions(request, runtime);
}

model PushNoticeToAndroidRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  body?: string(name='Body', description='This parameter is required.', example='body'),
  extParameters?: string(name='ExtParameters', example='{"key1":"value1","api_name":"PushNoticeToAndroidRequest"}'),
  jobKey?: string(name='JobKey', example='123'),
  storeOffline?: boolean(name='StoreOffline'),
  target?: string(name='Target', description='This parameter is required.', example='ALL'),
  targetValue?: string(name='TargetValue', description='This parameter is required.', example='ALL'),
  title?: string(name='Title', description='This parameter is required.', example='title'),
}

model PushNoticeToAndroidResponseBody = {
  messageId?: string(name='MessageId', example='501029'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model PushNoticeToAndroidResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushNoticeToAndroidResponseBody(name='body'),
}

/**
 * @summary 推送通知给Android设备
 *
 * @param request PushNoticeToAndroidRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushNoticeToAndroidResponse
 */
async function pushNoticeToAndroidWithOptions(request: PushNoticeToAndroidRequest, runtime: Util.RuntimeOptions): PushNoticeToAndroidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.body)) {
    query['Body'] = request.body;
  }
  if (!Util.isUnset(request.extParameters)) {
    query['ExtParameters'] = request.extParameters;
  }
  if (!Util.isUnset(request.jobKey)) {
    query['JobKey'] = request.jobKey;
  }
  if (!Util.isUnset(request.storeOffline)) {
    query['StoreOffline'] = request.storeOffline;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.targetValue)) {
    query['TargetValue'] = request.targetValue;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PushNoticeToAndroid',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 推送通知给Android设备
 *
 * @param request PushNoticeToAndroidRequest
 * @return PushNoticeToAndroidResponse
 */
async function pushNoticeToAndroid(request: PushNoticeToAndroidRequest): PushNoticeToAndroidResponse {
  var runtime = new Util.RuntimeOptions{};
  return pushNoticeToAndroidWithOptions(request, runtime);
}

model PushNoticeToiOSRequest {
  apnsEnv?: string(name='ApnsEnv', description='This parameter is required.', example='DEV'),
  appKey?: long(name='AppKey', description='This parameter is required.', example='24780725'),
  body?: string(name='Body', description='This parameter is required.', example='Hello World'),
  extParameters?: string(name='ExtParameters', example='{"k1":"ios","k2":"v2"}'),
  jobKey?: string(name='JobKey', example='123'),
  target?: string(name='Target', description='This parameter is required.', example='ALL'),
  targetValue?: string(name='TargetValue', description='This parameter is required.', example='ALL'),
  title?: string(name='Title', example='title'),
}

model PushNoticeToiOSResponseBody = {
  messageId?: string(name='MessageId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
  requestId?: string(name='RequestId', example='501029'),
}

model PushNoticeToiOSResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushNoticeToiOSResponseBody(name='body'),
}

/**
 * @summary 推送通知给iOS设备
 *
 * @param request PushNoticeToiOSRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushNoticeToiOSResponse
 */
async function pushNoticeToiOSWithOptions(request: PushNoticeToiOSRequest, runtime: Util.RuntimeOptions): PushNoticeToiOSResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apnsEnv)) {
    query['ApnsEnv'] = request.apnsEnv;
  }
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.body)) {
    query['Body'] = request.body;
  }
  if (!Util.isUnset(request.extParameters)) {
    query['ExtParameters'] = request.extParameters;
  }
  if (!Util.isUnset(request.jobKey)) {
    query['JobKey'] = request.jobKey;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.targetValue)) {
    query['TargetValue'] = request.targetValue;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PushNoticeToiOS',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 推送通知给iOS设备
 *
 * @param request PushNoticeToiOSRequest
 * @return PushNoticeToiOSResponse
 */
async function pushNoticeToiOS(request: PushNoticeToiOSRequest): PushNoticeToiOSResponse {
  var runtime = new Util.RuntimeOptions{};
  return pushNoticeToiOSWithOptions(request, runtime);
}

model QueryAliasesRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='e2ba19de97604f55b165576****'),
}

model QueryAliasesResponseBody = {
  aliasInfos?: {
    aliasInfo?: [ 
    {
      aliasName?: string(name='AliasName', example='test_alias1'),
    }
  ](name='AliasInfo')
  }(name='AliasInfos'),
  requestId?: string(name='RequestId', example='159E4422-6624-4750-8943-DFD98D34858C'),
}

model QueryAliasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAliasesResponseBody(name='body'),
}

/**
 * @summary 查询别名
 *
 * @param request QueryAliasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAliasesResponse
 */
async function queryAliasesWithOptions(request: QueryAliasesRequest, runtime: Util.RuntimeOptions): QueryAliasesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAliases',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询别名
 *
 * @param request QueryAliasesRequest
 * @return QueryAliasesResponse
 */
async function queryAliases(request: QueryAliasesRequest): QueryAliasesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAliasesWithOptions(request, runtime);
}

model QueryDeviceInfoRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23419851'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='a64ae296f3b04a58a05b30c9****'),
}

model QueryDeviceInfoResponseBody = {
  deviceInfo?: {
    account?: string(name='Account', example='test@aliyun.com'),
    alias?: string(name='Alias', example='test_alias,test_alias2'),
    brand?: string(name='Brand'),
    deviceId?: string(name='DeviceId', example='a64ae296f3b04a58a05b30c95****'),
    deviceToken?: string(name='DeviceToken', example='5ecc7b4012aaa801b63******5543ccbda6b4930d09629e936e1ac4b762a7df'),
    deviceType?: string(name='DeviceType', example='iOS'),
    lastOnlineTime?: string(name='LastOnlineTime', example='2018-03-27T02:19:40Z'),
    model?: string(name='Model'),
    online?: boolean(name='Online', example='false'),
    phoneNumber?: string(name='PhoneNumber', example='133********'),
    pushEnabled?: boolean(name='PushEnabled', example='true'),
    tags?: string(name='Tags', example='test_tag,test_tag2'),
  }(name='DeviceInfo'),
  requestId?: string(name='RequestId', example='6EEF262B-EA7D-41DC-89B9-20F3D1E28194'),
}

model QueryDeviceInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDeviceInfoResponseBody(name='body'),
}

/**
 * @summary 查询设备详情
 *
 * @param request QueryDeviceInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryDeviceInfoResponse
 */
async function queryDeviceInfoWithOptions(request: QueryDeviceInfoRequest, runtime: Util.RuntimeOptions): QueryDeviceInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDeviceInfo',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询设备详情
 *
 * @param request QueryDeviceInfoRequest
 * @return QueryDeviceInfoResponse
 */
async function queryDeviceInfo(request: QueryDeviceInfoRequest): QueryDeviceInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDeviceInfoWithOptions(request, runtime);
}

model QueryDeviceStatRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  deviceType?: string(name='DeviceType', example='iOS'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2016-07-29T00:00:00Z'),
  queryType?: string(name='QueryType', description='This parameter is required.', example='TOTAL'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2016-07-28T00:00:00Z'),
}

model QueryDeviceStatResponseBody = {
  appDeviceStats?: {
    appDeviceStat?: [ 
    {
      count?: long(name='Count', example='100'),
      deviceType?: string(name='DeviceType', example='iOS'),
      time?: string(name='Time', example='2016-07-28T16:00:00Z'),
    }
  ](name='AppDeviceStat')
  }(name='AppDeviceStats'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model QueryDeviceStatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDeviceStatResponseBody(name='body'),
}

/**
 * @summary 设备新增与留存
 *
 * @param request QueryDeviceStatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryDeviceStatResponse
 */
async function queryDeviceStatWithOptions(request: QueryDeviceStatRequest, runtime: Util.RuntimeOptions): QueryDeviceStatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceType)) {
    query['DeviceType'] = request.deviceType;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDeviceStat',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 设备新增与留存
 *
 * @param request QueryDeviceStatRequest
 * @return QueryDeviceStatResponse
 */
async function queryDeviceStat(request: QueryDeviceStatRequest): QueryDeviceStatResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDeviceStatWithOptions(request, runtime);
}

model QueryDevicesByAccountRequest {
  account?: string(name='Account', description='This parameter is required.', example='accountName'),
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
}

model QueryDevicesByAccountResponseBody = {
  deviceIds?: {
    deviceId?: [ string ](name='DeviceId')
  }(name='DeviceIds'),
  requestId?: string(name='RequestId', example='A8A24108-2AD0-4F6E-81C7-A8A24C2C2AD0'),
}

model QueryDevicesByAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDevicesByAccountResponseBody(name='body'),
}

/**
 * @summary 通过账户查询设备列表
 *
 * @param request QueryDevicesByAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryDevicesByAccountResponse
 */
async function queryDevicesByAccountWithOptions(request: QueryDevicesByAccountRequest, runtime: Util.RuntimeOptions): QueryDevicesByAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.account)) {
    query['Account'] = request.account;
  }
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDevicesByAccount',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 通过账户查询设备列表
 *
 * @param request QueryDevicesByAccountRequest
 * @return QueryDevicesByAccountResponse
 */
async function queryDevicesByAccount(request: QueryDevicesByAccountRequest): QueryDevicesByAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDevicesByAccountWithOptions(request, runtime);
}

model QueryDevicesByAliasRequest {
  alias?: string(name='Alias', description='This parameter is required.', example='aliasName'),
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
}

model QueryDevicesByAliasResponseBody = {
  deviceIds?: {
    deviceId?: [ string ](name='DeviceId')
  }(name='DeviceIds'),
  requestId?: string(name='RequestId', example='6A9FD644-35A5-40E4-89B0-2021CAEDC1B4'),
}

model QueryDevicesByAliasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDevicesByAliasResponseBody(name='body'),
}

/**
 * @summary 通过别名查询设备列表
 *
 * @param request QueryDevicesByAliasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryDevicesByAliasResponse
 */
async function queryDevicesByAliasWithOptions(request: QueryDevicesByAliasRequest, runtime: Util.RuntimeOptions): QueryDevicesByAliasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alias)) {
    query['Alias'] = request.alias;
  }
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDevicesByAlias',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 通过别名查询设备列表
 *
 * @param request QueryDevicesByAliasRequest
 * @return QueryDevicesByAliasResponse
 */
async function queryDevicesByAlias(request: QueryDevicesByAliasRequest): QueryDevicesByAliasResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDevicesByAliasWithOptions(request, runtime);
}

model QueryPushRecordsRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='333526247'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2021-09-29T06:24:58Z'),
  keyword?: string(name='Keyword'),
  nextToken?: string(name='NextToken', example='FFPpkmhCPm*****************xjk='),
  page?: int32(name='Page', example='8'),
  pageSize?: int32(name='PageSize', example='10'),
  pushType?: string(name='PushType', example='NOTICE'),
  source?: string(name='Source', example='API'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2021-09-15T02:05:24Z'),
  target?: string(name='Target', example='DEVICE'),
}

model QueryPushRecordsResponseBody = {
  nextToken?: string(name='NextToken', example='i91D***********kXIh/dVBEQ=='),
  page?: int32(name='Page', example='11'),
  pageSize?: int32(name='PageSize', example='20'),
  pushInfos?: {
    pushInfo?: [ 
    {
      appKey?: long(name='AppKey', example='333526247'),
      body?: string(name='Body', example='abcd'),
      deviceType?: string(name='DeviceType', example='ANDROID'),
      messageId?: string(name='MessageId', example='510431'),
      pushTime?: string(name='PushTime', example='2021-09-15T02:05:24Z'),
      pushType?: string(name='PushType', example='NOTICE'),
      source?: string(name='Source', example='DEVICE'),
      status?: string(name='Status', example='SENT'),
      target?: string(name='Target', example='DEVICE'),
      title?: string(name='Title', example='sssss'),
    }
  ](name='PushInfo')
  }(name='PushInfos'),
  requestId?: string(name='RequestId', example='9B24B396-249D-55E4-8CA1-66C9B50BB734'),
  total?: int32(name='Total', example='193'),
}

model QueryPushRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPushRecordsResponseBody(name='body'),
}

/**
 * @param request QueryPushRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPushRecordsResponse
 */
async function queryPushRecordsWithOptions(request: QueryPushRecordsRequest, runtime: Util.RuntimeOptions): QueryPushRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.pushType)) {
    query['PushType'] = request.pushType;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPushRecords',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request QueryPushRecordsRequest
 * @return QueryPushRecordsResponse
 */
async function queryPushRecords(request: QueryPushRecordsRequest): QueryPushRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPushRecordsWithOptions(request, runtime);
}

model QueryPushStatByAppRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2016-07-29T00:00:00Z'),
  granularity?: string(name='Granularity', description='This parameter is required.', example='DAY'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2016-07-25T00:00:00Z'),
}

model QueryPushStatByAppResponseBody = {
  appPushStats?: {
    appPushStat?: [ 
    {
      acceptCount?: long(name='AcceptCount', example='120'),
      deletedCount?: long(name='DeletedCount', example='10'),
      openedCount?: long(name='OpenedCount', example='30'),
      receivedCount?: long(name='ReceivedCount', example='60'),
      sentCount?: long(name='SentCount', example='100'),
      smsFailedCount?: long(name='SmsFailedCount', example='0'),
      smsReceiveFailedCount?: long(name='SmsReceiveFailedCount', example='0'),
      smsReceiveSuccessCount?: long(name='SmsReceiveSuccessCount', example='0'),
      smsSentCount?: long(name='SmsSentCount', example='0'),
      smsSkipCount?: long(name='SmsSkipCount', example='0'),
      time?: string(name='Time', example='2016-07-25T00:00:00Z'),
    }
  ](name='AppPushStat')
  }(name='AppPushStats'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model QueryPushStatByAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPushStatByAppResponseBody(name='body'),
}

/**
 * @summary App维度推送统计
 *
 * @param request QueryPushStatByAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPushStatByAppResponse
 */
async function queryPushStatByAppWithOptions(request: QueryPushStatByAppRequest, runtime: Util.RuntimeOptions): QueryPushStatByAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.granularity)) {
    query['Granularity'] = request.granularity;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPushStatByApp',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary App维度推送统计
 *
 * @param request QueryPushStatByAppRequest
 * @return QueryPushStatByAppResponse
 */
async function queryPushStatByApp(request: QueryPushStatByAppRequest): QueryPushStatByAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPushStatByAppWithOptions(request, runtime);
}

model QueryPushStatByMsgRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  messageId?: long(name='MessageId', description='This parameter is required.', example='510427'),
}

model QueryPushStatByMsgResponseBody = {
  pushStats?: {
    pushStat?: [ 
    {
      acceptCount?: long(name='AcceptCount', example='120'),
      deletedCount?: long(name='DeletedCount', example='10'),
      messageId?: string(name='MessageId', example='510427'),
      openedCount?: long(name='OpenedCount', example='30'),
      receivedCount?: long(name='ReceivedCount', example='60'),
      sentCount?: long(name='SentCount', example='100'),
      smsFailedCount?: long(name='SmsFailedCount', example='0'),
      smsReceiveFailedCount?: long(name='SmsReceiveFailedCount', example='0'),
      smsReceiveSuccessCount?: long(name='SmsReceiveSuccessCount', example='0'),
      smsSentCount?: long(name='SmsSentCount', example='0'),
      smsSkipCount?: long(name='SmsSkipCount', example='0'),
    }
  ](name='PushStat')
  }(name='PushStats'),
  requestId?: string(name='RequestId', example='CF195C34-98FB-491A-98D7-19CBC1FA880B'),
}

model QueryPushStatByMsgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPushStatByMsgResponseBody(name='body'),
}

/**
 * @summary 任务维度推送统计
 *
 * @param request QueryPushStatByMsgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPushStatByMsgResponse
 */
async function queryPushStatByMsgWithOptions(request: QueryPushStatByMsgRequest, runtime: Util.RuntimeOptions): QueryPushStatByMsgResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.messageId)) {
    query['MessageId'] = request.messageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPushStatByMsg',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 任务维度推送统计
 *
 * @param request QueryPushStatByMsgRequest
 * @return QueryPushStatByMsgResponse
 */
async function queryPushStatByMsg(request: QueryPushStatByMsgRequest): QueryPushStatByMsgResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPushStatByMsgWithOptions(request, runtime);
}

model QueryTagsRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  clientKey?: string(name='ClientKey', description='This parameter is required.', example='e2ba19de97604f55b165576****'),
  keyType?: string(name='KeyType', description='This parameter is required.', example='DEVICE'),
}

model QueryTagsResponseBody = {
  requestId?: string(name='RequestId', example='D68AE5C6-8AAF-46C9-B627-3FDACD1A4168'),
  tagInfos?: {
    tagInfo?: [ 
    {
      tagName?: string(name='TagName', example='test_tag2'),
    }
  ](name='TagInfo')
  }(name='TagInfos'),
}

model QueryTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTagsResponseBody(name='body'),
}

/**
 * @summary 查询标签列表
 *
 * @param request QueryTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTagsResponse
 */
async function queryTagsWithOptions(request: QueryTagsRequest, runtime: Util.RuntimeOptions): QueryTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.clientKey)) {
    query['ClientKey'] = request.clientKey;
  }
  if (!Util.isUnset(request.keyType)) {
    query['KeyType'] = request.keyType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTags',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询标签列表
 *
 * @param request QueryTagsRequest
 * @return QueryTagsResponse
 */
async function queryTags(request: QueryTagsRequest): QueryTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTagsWithOptions(request, runtime);
}

model QueryUniqueDeviceStatRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2016-07-26T00:00:00Z'),
  granularity?: string(name='Granularity', description='This parameter is required.', example='DAY'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2016-07-25T00:00:00Z'),
}

model QueryUniqueDeviceStatResponseBody = {
  appDeviceStats?: {
    appDeviceStat?: [ 
    {
      count?: long(name='Count', example='100'),
      time?: string(name='Time', example='2016-07-25T00:00:00Z'),
    }
  ](name='AppDeviceStat')
  }(name='AppDeviceStats'),
  requestId?: string(name='RequestId', example='9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC'),
}

model QueryUniqueDeviceStatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryUniqueDeviceStatResponseBody(name='body'),
}

/**
 * @summary 去重设备统计
 *
 * @param request QueryUniqueDeviceStatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryUniqueDeviceStatResponse
 */
async function queryUniqueDeviceStatWithOptions(request: QueryUniqueDeviceStatRequest, runtime: Util.RuntimeOptions): QueryUniqueDeviceStatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.granularity)) {
    query['Granularity'] = request.granularity;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryUniqueDeviceStat',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 去重设备统计
 *
 * @param request QueryUniqueDeviceStatRequest
 * @return QueryUniqueDeviceStatResponse
 */
async function queryUniqueDeviceStat(request: QueryUniqueDeviceStatRequest): QueryUniqueDeviceStatResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryUniqueDeviceStatWithOptions(request, runtime);
}

model RemoveTagRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  tagName?: string(name='TagName', description='This parameter is required.', example='test_tag'),
}

model RemoveTagResponseBody = {
  requestId?: string(name='RequestId', example='23000F3C-0EFE-4C89-82EE-E04F42D37B3C'),
}

model RemoveTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveTagResponseBody(name='body'),
}

/**
 * @summary 删除标签
 *
 * @param request RemoveTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveTagResponse
 */
async function removeTagWithOptions(request: RemoveTagRequest, runtime: Util.RuntimeOptions): RemoveTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveTag',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除标签
 *
 * @param request RemoveTagRequest
 * @return RemoveTagResponse
 */
async function removeTag(request: RemoveTagRequest): RemoveTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeTagWithOptions(request, runtime);
}

model UnbindAliasRequest {
  aliasName?: string(name='AliasName', example='test_alias'),
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='e2ba19de97604f55b16557673****'),
  unbindAll?: boolean(name='UnbindAll', example='true'),
}

model UnbindAliasResponseBody = {
  requestId?: string(name='RequestId', example='159E4422-6624-4750-8943-DFD98D34858C'),
}

model UnbindAliasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindAliasResponseBody(name='body'),
}

/**
 * @summary 解绑别名
 *
 * @param request UnbindAliasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindAliasResponse
 */
async function unbindAliasWithOptions(request: UnbindAliasRequest, runtime: Util.RuntimeOptions): UnbindAliasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliasName)) {
    query['AliasName'] = request.aliasName;
  }
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!Util.isUnset(request.unbindAll)) {
    query['UnbindAll'] = request.unbindAll;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindAlias',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 解绑别名
 *
 * @param request UnbindAliasRequest
 * @return UnbindAliasResponse
 */
async function unbindAlias(request: UnbindAliasRequest): UnbindAliasResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindAliasWithOptions(request, runtime);
}

model UnbindPhoneRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='eb5f741d83d04d34807d229999eefa52'),
}

model UnbindPhoneResponseBody = {
  requestId?: string(name='RequestId', example='0D1126F0-F8FF-513D-BAFA-F140447BDED4'),
}

model UnbindPhoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindPhoneResponseBody(name='body'),
}

/**
 * @summary 解绑手机号码
 *
 * @param request UnbindPhoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindPhoneResponse
 */
async function unbindPhoneWithOptions(request: UnbindPhoneRequest, runtime: Util.RuntimeOptions): UnbindPhoneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindPhone',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 解绑手机号码
 *
 * @param request UnbindPhoneRequest
 * @return UnbindPhoneResponse
 */
async function unbindPhone(request: UnbindPhoneRequest): UnbindPhoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindPhoneWithOptions(request, runtime);
}

model UnbindTagRequest {
  appKey?: long(name='AppKey', description='This parameter is required.', example='23267207'),
  clientKey?: string(name='ClientKey', description='This parameter is required.', example='e2ba19de97604f55b16557673****'),
  keyType?: string(name='KeyType', description='This parameter is required.', example='DEVICE'),
  tagName?: string(name='TagName', description='This parameter is required.', example='test_tag1,test_tag2'),
}

model UnbindTagResponseBody = {
  requestId?: string(name='RequestId', example='159E4422-6624-4750-8943-DFD98D34858C'),
}

model UnbindTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindTagResponseBody(name='body'),
}

/**
 * @summary 绑定标签
 *
 * @param request UnbindTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindTagResponse
 */
async function unbindTagWithOptions(request: UnbindTagRequest, runtime: Util.RuntimeOptions): UnbindTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.clientKey)) {
    query['ClientKey'] = request.clientKey;
  }
  if (!Util.isUnset(request.keyType)) {
    query['KeyType'] = request.keyType;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindTag',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 绑定标签
 *
 * @param request UnbindTagRequest
 * @return UnbindTagResponse
 */
async function unbindTag(request: UnbindTagRequest): UnbindTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindTagWithOptions(request, runtime);
}

